// 防抖函数
const debounce = (fn: Function, wait: number): ()=>void => {
    let timer: null | number
    return () => {
        if (timer) clearTimeout(timer)
        timer = setTimeout(fn, wait)
    }
}

// 获取input框的内容
const getValue = (event) => {
    console.log(input.value);
}

// 获取input标签
let input: HTMLInputElement = document.getElementById('myInput') as HTMLInputElement

// input框的输入事件
input.oninput = debounce(getValue, 1000)
export {}